import request from '../utils/request';
import config from './../utils/config';
export async function getMuens(param) {
  console.info(param);
  if(config.isDev){
    return request('http://localhost:63343/configcreate/json/muens.json');
  } else {
    return request(config.CADILLAC_URL+'/menuController/getUserMenus?menuGroupId='+(param||''), {
      method: 'GET',
      mode: 'no-cors',
      credentials:'include'
    })
  }
}
export async function getFirstMuens(param) {
  if(config.isDev){
    return request('http://localhost:63343/configcreate/json/first.json');
  } else {
    return request(config.CADILLAC_URL+'/menuGroup/getNonemptyGroups', {
      method: 'GET',
      mode: 'no-cors',
      credentials:'include'
    })
  }
}
export function login () {
  // return request('http://10.120.10.28:8030/cadillac/login/login?username=admin&password=111111', {
  //   method: 'GET',
  //   mode: 'no-cors',
  //   credentials:'include'
  // })
  return request(config.CADILLAC_URL+'/login/login?username=admin&password=111111', {
    method: 'GET',
    mode: 'no-cors',
    credentials:'include'
  })
}
